package com.example.communist_app_api.db.dao;

import com.example.communist_app_api.db.dto.ActivityUniAppPersonalDTO;
import com.example.communist_app_api.db.pojoDto.UserActivity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.joda.time.DateTime;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Mapper
public interface UserActivityDao {

    Integer getAttendActivityNum(@Param("activityId") Integer activityId);

    void updateDeleteUserActivity(Integer id);

    List<Integer> getUserIdListByActivityId(Integer activityId);

    List<UserActivity> getUserActivityListByActivityId(Integer activityId);

    void insertByUserIdAndActivityId(@Param("userId") int userId, @Param("activityId") Integer activityId);

    Integer getExistenceByUserIdAndActivityId(@Param("userId")int userId, @Param("activityId")Integer activityId);

    Integer getCountByUserId(Integer userId);

    List<ActivityUniAppPersonalDTO> getActivityRecordByTitleAndUserId(@Param("title") String title,@Param("userId") Integer userId);

    List<UserActivity> getSignUpListByUserId(Integer userId);

    int updateUserActivityByActivityIdAndUserId(@Param("activityId") Integer activityId, @Param("userId") Integer userId,@Param("date") Date date);

    UserActivity getUserActivityByActivityIdAndUserId(@Param("activityId") Integer activityId, @Param("userId") Integer userId);

    DateTime getSignTimeByUserIdAndActivityId(@Param("userId") int userId, @Param("activityId") Integer activityId);

    void cancelActivitySignUp(@Param("activityId") Integer activityId, @Param("userId") Integer userId);
}
